import java.util.Arrays;
import java.util.Scanner;

public class Test1 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
         int t = scanner.nextInt();
        long[]array = new long[3*t];
        for (int i = 0; i < array.length; i++) {
            array[i] = scanner.nextInt();
        }
        Arrays.sort(array);
        int j = 0;
        int size = array.length-1;
        long sum = 0;
        for (int i = 0; i < t; i++) {
               long ret = array[--size];
               size--;
               sum+=ret;
        }
        System.out.println(sum);
    }
}

